//
//  API.m
//  YouTao
//
//  Created by David on 15/1/22.
//  Copyright (c) 2015年 KOTO. All rights reserved.
//

#import "API.h"

@implementation API

NSString * const MDYApiBaseUrl = @"https://www.maideyi.com/api/";
NSString * const YHJApiBaseUrl = @"http://www.youhuijia.com/app/";

/**
 *  得到完整api
 *
 *  @param api api名称
 *
 *  @return 完整的api路径
 */
inline NSString * GetMDYApiWithName(NSString *apiName)
{
    NSString *retApi = apiName;
    if (!([[apiName lowercaseString] hasPrefix:@"http://"] || [[apiName lowercaseString] hasPrefix:@"https://"])) {
        retApi = [MDYApiBaseUrl stringByAppendingString:apiName];
    }
    return retApi;
}

inline NSString * GetYHJApiWithName(NSString *apiName)
{
    NSString *retApi = apiName;
    if (!([[apiName lowercaseString] hasPrefix:@"http://"] || [[apiName lowercaseString] hasPrefix:@"https://"])) {
        retApi = [YHJApiBaseUrl stringByAppendingString:apiName];
    }
    return retApi;
}


#pragma mark - 买得易API
// -------------------------- 买得易API --------------------------

/**
 *  将买得易接口中的shoplink字符串直接拼接到接口访问
 */
NSString * const API_MDYShopLink = @"http://c.maideyi.com/md";

/**
 splink:iphone
 splinkhd:ipad
 sptype=1:子分类
 */
// sp https://www.maideyi.com/api/sp1.json
NSString * const API_MDYSP1 = @"https://www.maideyi.com/api/sp1.json";
// sp https://www.maideyi.com/api/sp2.json
NSString * const API_MDYSP2 = @"https://www.maideyi.com/api/sp2.json";
// sp https://www.maideyi.com/api/sp3.json
NSString * const API_MDYSP3 = @"https://www.maideyi.com/api/sp3.json";
// sp https://www.maideyi.com/api/sp4.json
NSString * const API_MDYSP4 = @"https://www.maideyi.com/api/sp4.json";
// sp https://www.maideyi.com/api/sp5.json
NSString * const API_MDYSP5 = @"https://www.maideyi.com/api/sp5.json";

//新闻资讯 https://www.maideyi.com/api/zx.json
NSString * const API_MDYzx = @"https://www.maideyi.com/api/zx.json";

//优惠 https://www.maideyi.com/api/yh.json
NSString * const API_MDYyh = @"https://www.maideyi.com/api/yh.json";
//淘客 https://www.maideyi.com/api/taobao.json
NSString * const API_MDYtaobao = @"https://www.maideyi.com/api/taobao.json";
//京东买得易 https://www.maideyi.com/api/jd.json
NSString * const API_MDYjd = @"https://www.maideyi.com/api/jd.json";
//海淘 https://www.maideyi.com/api/ht.json
NSString * const API_MDYht = @"https://www.maideyi.com/api/ht.json";

// 14 https://www.maideyi.com/api/14.json【购物导航 首页最后一屏数据】
NSString * const API_MDY14 = @"https://www.maideyi.com/api/14.json";

//精选=优选商品，比优选商品多两个字段：author，view: https://www.maideyi.com/api/gwdr.json
NSString * const API_MDYgwdr = @"https://www.maideyi.com/api/gwdr.json";
//今日特价: https://www.maideyi.com/api/107.json
NSString * const API_MDY107 = @"https://www.maideyi.com/api/107.json";
//优选商品 https://www.maideyi.com/api/youxuan.json
NSString * const API_MDYyouxuan = @"https://www.maideyi.com/api/youxuan.json";
//首屏顶部推荐商品: top
NSString * const API_MDYtop = @"https://www.maideyi.com/api/top.json";

//手机 36
NSString * const API_MDY36 = @"https://www.maideyi.com/api/36.json";
//化妆品 38
NSString * const API_MDY38 = @"https://www.maideyi.com/api/38.json";
//珠宝饰品 44
NSString * const API_MDY44 = @"https://www.maideyi.com/api/44.json";
//运动户外 54
NSString * const API_MDY54 = @"https://www.maideyi.com/api/54.json";
//女装 63
NSString * const API_MDY63 = @"https://www.maideyi.com/api/63.json";
//女鞋 64
NSString * const API_MDY64 = @"https://www.maideyi.com/api/64.json";
//男装 65
NSString * const API_MDY65 = @"https://www.maideyi.com/api/65.json";
//男鞋 66
NSString * const API_MDY66 = @"https://www.maideyi.com/api/66.json";
//箱包 67
NSString * const API_MDY67 = @"https://www.maideyi.com/api/67.json";
//零食 71
NSString * const API_MDY71 = @"https://www.maideyi.com/api/71.json";
//内衣 81
NSString * const API_MDY81 = @"https://www.maideyi.com/api/81.json";
//个人护理 82
NSString * const API_MDY82 = @"https://www.maideyi.com/api/82.json";
//腕表 83
NSString * const API_MDY83 = @"https://www.maideyi.com/api/83.json";
//眼镜 84
NSString * const API_MDY84 = @"https://www.maideyi.com/api/84.json";
//数码 85
NSString * const API_MDY85 = @"https://www.maideyi.com/api/85.json";
//电脑办公 86
NSString * const API_MDY86 = @"https://www.maideyi.com/api/86.json";
//母婴 87
NSString * const API_MDY87 = @"https://www.maideyi.com/api/87.json";
//玩具 88
NSString * const API_MDY88 = @"https://www.maideyi.com/api/88.json";
//进口食品 90
NSString * const API_MDY90 = @"https://www.maideyi.com/api/90.json";
//茶酒 91
NSString * const API_MDY91 = @"https://www.maideyi.com/api/91.json";
//大家电 92
NSString * const API_MDY92 = @"https://www.maideyi.com/api/92.json";
//生活电器 93
NSString * const API_MDY93 = @"https://www.maideyi.com/api/93.json";
//家具建材 94
NSString * const API_MDY94 = @"https://www.maideyi.com/api/94.json";
//汽配 96
NSString * const API_MDY96 = @"https://www.maideyi.com/api/96.json";
//汽车用品 97
NSString * const API_MDY97 = @"https://www.maideyi.com/api/97.json";
//家纺 98
NSString * const API_MDY98 = @"https://www.maideyi.com/api/98.json";
//布艺 99
NSString * const API_MDY99 = @"https://www.maideyi.com/api/99.json";
//鲜花 100
NSString * const API_MDY100 = @"https://www.maideyi.com/api/100.json";
//医药保健 101
NSString * const API_MDY101 = @"https://www.maideyi.com/api/101.json";
//厨具 102
NSString * const API_MDY102 = @"https://www.maideyi.com/api/102.json";
//收纳 103
NSString * const API_MDY103 = @"https://www.maideyi.com/api/103.json";
//宠物 104
NSString * const API_MDY104 = @"https://www.maideyi.com/api/104.json";
//图书音像 105
NSString * const API_MDY105 = @"https://www.maideyi.com/api/105.json";
//天猫 106
NSString * const API_MDY106 = @"https://www.maideyi.com/api/106.json";


#pragma mark - 优惠价API
// -------------------------- 优惠价API --------------------------
//全部 http://www.youhuijia.com/app/all.json
NSString * const API_YHJAll = @"http://www.youhuijia.com/app/all.json";
//顶部轮动 http://www.youhuijia.com/app/top.json
NSString * const API_YHJBanner = @"http://www.youhuijia.com/app/top.json";
//天天惠顶部轮动 http://www.youhuijia.com/app/days.json （无数据）
NSString * const API_YHJTianTianHuiBanner = @"http://www.youhuijia.com/app/days.json";
//最新 http://www.youhuijia.com/app/new.json
NSString * const API_YHJZuiXin = @"http://www.youhuijia.com/app/new.json";
//最热 http://www.youhuijia.com/app/hot.json
NSString * const API_YHJZuiRe = @"http://www.youhuijia.com/app/hot.json";
//精选 http://www.youhuijia.com/app/sp.json
NSString * const API_YHJJingXuan = @"http://www.youhuijia.com/app/sp.json";
//新品：http://www.youhuijia.com/app/np.json
NSString * const API_YHJXinPin = @"http://www.youhuijia.com/app/np.json";
//特卖 http://www.youhuijia.com/app/9.json
NSString * const API_YHJTeMai = @"http://www.youhuijia.com/app/9.json";
//天天惠 http://www.youhuijia.com/app/day.json
NSString * const API_YHJTianTianHui = @"http://www.youhuijia.com/app/day.json";

//母婴 http://www.youhuijia.com/app/my.json
NSString * const API_YHJMuYing = @"http://www.youhuijia.com/app/my.json";
//女装 http://www.youhuijia.com/app/37.json
NSString * const API_YHJNvZhuang = @"http://www.youhuijia.com/app/37.json";
//男装 http://www.youhuijia.com/app/38.json
NSString * const API_YHJNanZhuang = @"http://www.youhuijia.com/app/38.json";
//鞋包 http://www.youhuijia.com/app/39.json
NSString * const API_YHJXieBao = @"http://www.youhuijia.com/app/39.json";
//内衣http://www.youhuijia.com/app/40.json
NSString * const API_YHJNeiYi = @"http://www.youhuijia.com/app/40.json";
//饰品 http://www.youhuijia.com/app/41.json
NSString * const API_YHJShiPin = @"http://www.youhuijia.com/app/41.json";
//运动 http://www.youhuijia.com/app/42.json
NSString * const API_YHJYunDong = @"http://www.youhuijia.com/app/42.json";
//户外 http://www.youhuijia.com/app/43.json
NSString * const API_YHJHuWai = @"http://www.youhuijia.com/app/43.json";
//玩具 http://www.youhuijia.com/app/44.json
NSString * const API_YHJWanJu = @"http://www.youhuijia.com/app/44.json";
//美妆 http://www.youhuijia.com/app/45.json
NSString * const API_YHJMeiZhuang = @"http://www.youhuijia.com/app/45.json";
//汽车用品 http://www.youhuijia.com/app/46.json
NSString * const API_YHJQiCheYongPin = @"http://www.youhuijia.com/app/46.json";
//健康 http://www.youhuijia.com/app/47.json
NSString * const API_YHJJianKang = @"http://www.youhuijia.com/app/47.json";
//手机 http://www.youhuijia.com/app/48.json
NSString * const API_YHJShouJi = @"http://www.youhuijia.com/app/48.json";
//数码 http://www.youhuijia.com/app/dg.json
NSString * const API_YHJShuMa = @"http://www.youhuijia.com/app/dg.json";
//时尚 http://www.youhuijia.com/app/fs.json
NSString * const API_YHJShiShang = @"http://www.youhuijia.com/app/fs.json";
//家居 http://www.youhuijia.com/app/home.json
NSString * const API_YHJJiaJu = @"http://www.youhuijia.com/app/home.json";
//美食 http://www.youhuijia.com/app/ms.json
NSString * const API_YHJMeiShi = @"http://www.youhuijia.com/app/ms.json";

//母婴百科 http://www.youhuijia.com/app/muying.json
NSString * const API_YHJMuYingBaiKe = @"http://www.youhuijia.com/app/muying.json";
//产前产后 http://www.youhuijia.com/app/cqch.json
NSString * const API_YHJChanQianChanHou = @"http://www.youhuijia.com/app/cqch.json";
//孕妈穿着 http://www.youhuijia.com/app/ymcz.json
NSString * const API_YHJYunMaChuangZhuo = @"http://www.youhuijia.com/app/ymcz.json";
//孕妈营养 http://www.youhuijia.com/app/ymyr.json
NSString * const API_YHJYunMaYingYang = @"http://www.youhuijia.com/app/ymyr.json";
//孕妈护肤 http://www.youhuijia.com/app/ymff.json
NSString * const API_YHJYunMaHuFu = @"http://www.youhuijia.com/app/ymff.json";
//纸尿裤 http://www.youhuijia.com/app/zlk.json
NSString * const API_YHJZhiNiaoKu = @"http://www.youhuijia.com/app/zlk.json";
//奶粉 http://www.youhuijia.com/app/nf.json
NSString * const API_YHJNaiFen = @"http://www.youhuijia.com/app/nf.json";
//童装童鞋 http://www.youhuijia.com/app/tztx.json
NSString * const API_YHJTongZhuangTongXie = @"http://www.youhuijia.com/app/tztx.json";
//喂养洗护 http://www.youhuijia.com/app/wyxh.json
NSString * const API_YHJWeiYangXiHu = @"http://www.youhuijia.com/app/wyxh.json";
//童车床 http://www.youhuijia.com/app/tcc.json
NSString * const API_YHJTongCheChuang = @"http://www.youhuijia.com/app/tcc.json";

#pragma mark - 多米新闻API
// -------------------------- 多米新闻API --------------------------
//热点 : http://cn.doome.com/api/hot.json
NSString * const API_DMHot = @"http://cn.doome.com/api/hot.json";
//娱乐 : http://cn.doome.com/api/2.json  (yl.json)
NSString * const API_DMYuLe = @"http://cn.doome.com/api/2.json";
//动画 : http://cn.doome.com/api/780.json  (dh.json)
NSString * const API_DMDongHua = @"http://cn.doome.com/api/780.json";
//音乐 : http://cn.doome.com/api/776.json  (yy.json)
NSString * const API_DMYinYue = @"http://cn.doome.com/api/776.json";
//舞蹈 : http://cn.doome.com/api/777.json   (wd.json)
NSString * const API_DMWuDao = @"http://cn.doome.com/api/777.json";
//游戏 : http://cn.doome.com/api/773.json    (yx.json)
NSString * const API_DMYouXi = @"http://cn.doome.com/api/773.json";
//科技 : http://cn.doome.com/api/5.json   (kj.json)
NSString * const API_DMKeJi = @"http://cn.doome.com/api/5.json";
//影视 : http://cn.doome.com/api/774.json  (ys.json)  (暂时没数据)
NSString * const API_DMYingShi = @"http://cn.doome.com/api/774.json";
//体育 : http://cn.doome.com/api/7.json   (ty.json)
NSString * const API_DMTiYu = @"http://cn.doome.com/api/7.json";
//彼女 : http://cn.doome.com/api/11.json  (pl.jspn)
NSString * const API_DMBiNv = @"http://cn.doome.com/api/11.json";
//军事 : http://cn.doome.com/api/4.json  (js.json)
NSString * const API_DMJunShi = @"http://cn.doome.com/api/4.json";
//新闻 : http://cn.doome.com/api/1.json  (xw.json)
NSString * const API_DMXinWen = @"http://cn.doome.com/api/1.json";


#pragma mark - 搜索接口
// 购物搜索 cnebuy，直接拼接关键字
NSString * const API_SearchCnebuy = @"http://m.cnebuy.com/zhao-";
NSString * const API_SearchCnebuy_iPad = @"http://www.cnebuy.com/zhao-";

// 购物搜索 doome，直接拼接关键字
NSString * const API_SearchDoome = @"http://m.doo.me/zhao-";
NSString * const API_SearchDoome_iPad = @"http://doo.me/go-";

// 多米搜索，直接拼接关键字
NSString * const API_DoomeSearch = @"http://www.doo.me/k/";

// 关键字网址检索接口 http://doo.me/gw/gw.json
NSString * const API_TagsToSite = @"http://doo.me/gw/gw.json";

// 热门搜索（搜索热词）接口：https://www.maideyi.com/api/keyword.json
NSString * const API_MDYHotSearchWords = @"https://www.maideyi.com/api/keyword.json";

// 多米新闻 接口：http://cn.doome.com/api/thenews.json
NSString * const API_DoomeNews = @"http://cn.doome.com/api/thenews.json";


//手机 147
NSString * const API_MDYNewsShouJi = @"https://www.maideyi.com/api/147.json";
//汽车  8
NSString * const API_MDYNewsQiChe = @"https://www.maideyi.com/api/8.json";
//数码  57
NSString * const API_MDYNewsShuMa = @"https://www.maideyi.com/api/57.json";
//游戏 148
NSString * const API_MDYNewsYouXi = @"https://www.maideyi.com/api/148.json";
//电脑  149
NSString * const API_MDYNewsDianNao = @"https://www.maideyi.com/api/149.json";
//社会新闻 151
NSString * const API_MDYNewsSheHui = @"https://www.maideyi.com/api/151.json";
//母婴  4
NSString * const API_MDYNewsMuYing = @"https://www.maideyi.com/api/4.json";
//美容  150
NSString * const API_MDYNewsMeiRong = @"https://www.maideyi.com/api/150.json";
//健康  10
NSString * const API_MDYNewsJianKang = @"https://www.maideyi.com/api/10.json";
//宠物  11
NSString * const API_MDYNewsChongWu = @"https://www.maideyi.com/api/11.json";
//科技   5
NSString * const API_MDYNewsKeJi = @"https://www.maideyi.com/api/5.json";
//时尚   6
NSString * const API_MDYNewsShiShang = @"https://www.maideyi.com/api/6.json";
//户外  54
NSString * const API_MDYNewsHuWai = @"https://www.maideyi.com/api/54.json";
//旅游  9
NSString * const API_MDYNewsLvYou = @"https://www.maideyi.com/api/9.json";
@end
